﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    mc:Ignorable="d">
	<!-- Resource dictionary entries should be defined here. -->
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Colors.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type ScrollBar}">
        <Setter Property="MinWidth" Value="17"/>
        <Setter Property="MinHeight" Value="17"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto" />
                <Setter Property="Height" Value="17" />
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=HorizontalScrollBarTemplate, TypeInTargetAssembly={x:Type ScrollBar}}}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="17" />
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=VerticalScrollBarTemplate, TypeInTargetAssembly={x:Type ScrollBar}}}" />
            </Trigger>
        </Style.Triggers>
	</Style>

    <!-- RepeatButton Templates -->
    <ControlTemplate x:Key="ScrollBarRepeatButtonTemplate" TargetType="RepeatButton">
        <Grid x:Name="Root" Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
        </Grid>
    </ControlTemplate>

    <!-- Horizontal Inc/Dec Templates -->
    <ControlTemplate x:Key="ScrollBarHorizontalIncrementTemplate" TargetType="RepeatButton">
        <Grid x:Name="Root">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition From="Normal" GeneratedDuration="0:0:0.4" To="MouseOver"/>
                        <VisualTransition From="MouseOver" GeneratedDuration="0:0:0.4" To="Normal"/>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Move}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Pressed}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="Background" Opacity="1" RadiusX="2" RadiusY="2" StrokeThickness="1" Stroke="{x:Null}">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{StaticResource Application_ScrollBar_Background}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Path x:Name="path" Stretch="Uniform" Height="8" Width="4" Data="F1 M 0,10L 0,0L 6,5L 0,10 Z ">
                <Path.Fill>
                    <SolidColorBrush x:Name="ButtonColor" Color="{StaticResource Application_ScrollBar_Foreground}" />
                </Path.Fill>
            </Path>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="ScrollBarHorizontalDecrementTemplate" TargetType="RepeatButton">
        <Grid x:Name="Root">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition From="Normal" GeneratedDuration="0:0:0.4" To="MouseOver"/>
                        <VisualTransition From="MouseOver" GeneratedDuration="0:0:0.4" To="Normal"/>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Move}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Pressed}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="Background" Opacity="1" RadiusX="2" RadiusY="2" StrokeThickness="1" Stroke="{x:Null}">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{StaticResource Application_ScrollBar_Background}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Path x:Name="path" Stretch="Uniform" Height="8" Width="4" Data="F1 M 10,0L 10,10L 4,5L 10,0 Z ">
                <Path.Fill>
                    <SolidColorBrush Color="{StaticResource Application_ScrollBar_Foreground}"/>
                </Path.Fill>
            </Path>
        </Grid>
    </ControlTemplate>

    <!-- Vertical Inc/Dec Templates -->
    <ControlTemplate x:Key="ScrollBarVerticalIncrementTemplate" TargetType="RepeatButton">
        <Grid x:Name="Root">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition From="Normal" GeneratedDuration="0:0:0.4" To="MouseOver"/>
                        <VisualTransition From="MouseOver" GeneratedDuration="0:0:0.4" To="Normal"/>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Move}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Pressed}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="Background" Opacity="1" RadiusX="2" RadiusY="2" StrokeThickness="1" Stroke="{x:Null}">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{StaticResource Application_ScrollBar_Background}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Path x:Name="path" Stretch="Uniform" Height="4" Width="8" Data="F1 M 0,0L 10,0L 5,6L 0,0 Z ">
                <Path.Fill>
                    <SolidColorBrush x:Name="ButtonColor" Color="{StaticResource Application_ScrollBar_Foreground}" />
                </Path.Fill>
            </Path>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="ScrollBarVerticalDecrementTemplate" TargetType="RepeatButton">
        <Grid x:Name="Root">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition From="MouseOver" GeneratedDuration="0:0:0.4" To="Normal"/>
                        <VisualTransition From="Normal" GeneratedDuration="0:0:0.4" To="MouseOver"/>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Move}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Pressed}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="Background" Opacity="0" RadiusX="2" RadiusY="2" StrokeThickness="1" Stroke="{x:Null}">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{StaticResource Application_ScrollBar_Background}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Path x:Name="path" Stretch="Uniform" Height="4" Width="8" Data="F1 M 10,10L 0,10L 5,4L 10,10 Z ">
                <Path.Fill>
                    <SolidColorBrush x:Name="ButtonColor" Color="{StaticResource Application_ScrollBar_Foreground}" />
                </Path.Fill>
            </Path>
        </Grid>
    </ControlTemplate>

    <!-- Thumb Templates -->
    <ControlTemplate x:Key="ScrollBarThumbTemplate" TargetType="Thumb">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition From="Normal" GeneratedDuration="0:0:0.4" To="MouseOver"/>
                        <VisualTransition From="MouseOver" GeneratedDuration="0:0:0.4" To="Normal"/>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="Background">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Move}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="Background">
                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Application_ScrollBar_Foreground_Pressed}"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity" To="0" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="ThumbVisual" Margin="0" Height="Auto">
                <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" StrokeThickness="1" Stroke="{x:Null}">
                    <Rectangle.Fill>
                        <SolidColorBrush Color="{StaticResource Application_ScrollBar_Foreground}"/>
                    </Rectangle.Fill>
                </Rectangle>
            </Grid>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=VerticalScrollBarTemplate, TypeInTargetAssembly={x:Type ScrollBar}}"
                     TargetType="{x:Type ScrollBar}">
        <Grid>
    		<Grid.RowDefinitions>
    			<RowDefinition MaxHeight="17" />
    			<RowDefinition Height="0.00001*" />
    			<RowDefinition MaxHeight="17" />
    		</Grid.RowDefinitions>
    		<VisualStateManager.VisualStateGroups>
    			<VisualStateGroup x:Name="CommonStates">
    				<VisualStateGroup.Transitions>
    					<VisualTransition From="Normal" GeneratedDuration="0:0:0.4" To="MouseOver"/>
    					<VisualTransition From="MouseOver" GeneratedDuration="0:0:0.4" To="Normal"/>
    				</VisualStateGroup.Transitions>
    				<VisualState x:Name="Normal"/>
    				<VisualState x:Name="MouseOver">
    					<Storyboard>
    						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_Track">
    							<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    						</DoubleAnimationUsingKeyFrames>
    						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="repeatButton">
    							<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    						</DoubleAnimationUsingKeyFrames>
    						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="repeatButton1">
    							<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    						</DoubleAnimationUsingKeyFrames>
    					</Storyboard>
    				</VisualState>
    				<VisualState x:Name="Disabled"/>
    			</VisualStateGroup>
    		</VisualStateManager.VisualStateGroups>
    		<Border Grid.RowSpan="3">
    			<Border.Background>
    				<SolidColorBrush Color="{StaticResource Application_ScrollBar_Background}"/>
    			</Border.Background>
    		</Border>
    		<RepeatButton x:Name="repeatButton" Grid.Row="0" Template="{DynamicResource ScrollBarVerticalDecrementTemplate}" Height="18" Command="ScrollBar.LineUpCommand" Opacity="0"/>
    		<Track x:Name="PART_Track" Grid.Row="1" IsDirectionReversed="true" Opacity="0.5">
    			<Track.DecreaseRepeatButton>
    				<RepeatButton Template="{DynamicResource ScrollBarRepeatButtonTemplate}" Command="ScrollBar.PageUpCommand"/>
    			</Track.DecreaseRepeatButton>
    			<Track.Thumb>
    				<Thumb Template="{DynamicResource ScrollBarThumbTemplate}" Margin="5,0,5,0"/>
    			</Track.Thumb>
    			<Track.IncreaseRepeatButton>
    				<RepeatButton Template="{DynamicResource ScrollBarRepeatButtonTemplate}" Command="ScrollBar.PageDownCommand" />
    			</Track.IncreaseRepeatButton>
    		</Track>
    		<RepeatButton x:Name="repeatButton1" Grid.Row="3" Template="{DynamicResource ScrollBarVerticalIncrementTemplate}" Height="18" Command="ScrollBar.LineDownCommand" Opacity="0"/>
    	</Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=HorizontalScrollBarTemplate, TypeInTargetAssembly={x:Type ScrollBar}}"
                 TargetType="{x:Type ScrollBar}">
        <Grid>
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition MaxWidth="18" />
    			<ColumnDefinition Width="0.00001*" />
    			<ColumnDefinition MaxWidth="18" />
    		</Grid.ColumnDefinitions>
    		<VisualStateManager.VisualStateGroups>
    			<VisualStateGroup x:Name="CommonStates">
    				<VisualStateGroup.Transitions>
    					<VisualTransition From="Normal" GeneratedDuration="0:0:0.4" To="MouseOver"/>
    					<VisualTransition From="MouseOver" GeneratedDuration="0:0:0.4" To="Normal"/>
    				</VisualStateGroup.Transitions>
    				<VisualState x:Name="Normal"/>
    				<VisualState x:Name="MouseOver">
    					<Storyboard>
    						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_Track">
    							<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    						</DoubleAnimationUsingKeyFrames>
    						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="repeatButton">
    							<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    						</DoubleAnimationUsingKeyFrames>
    						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="repeatButton1">
    							<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    						</DoubleAnimationUsingKeyFrames>
    					</Storyboard>
    				</VisualState>
    				<VisualState x:Name="Disabled"/>
    			</VisualStateGroup>
    		</VisualStateManager.VisualStateGroups>
    		<Border Grid.ColumnSpan="3">
    			<Border.Background>
    				<SolidColorBrush Color="{StaticResource Application_ScrollBar_Background}"/>
    			</Border.Background>
    		</Border>
    		<RepeatButton x:Name="repeatButton" Grid.Column="0" Template="{DynamicResource ScrollBarHorizontalDecrementTemplate}" Width="17" Command="ScrollBar.LineLeftCommand" Opacity="0"/>
    		<Track x:Name="PART_Track" Grid.Column="1" IsDirectionReversed="False" Opacity="0.5">
    			<Track.DecreaseRepeatButton>
    				<RepeatButton Template="{DynamicResource ScrollBarRepeatButtonTemplate}" Command="ScrollBar.PageLeftCommand" />
    			</Track.DecreaseRepeatButton>
    			<Track.Thumb>
    				<Thumb Template="{DynamicResource ScrollBarThumbTemplate}" Margin="0,5,0,5"/>
    			</Track.Thumb>
    			<Track.IncreaseRepeatButton>
    				<RepeatButton Template="{DynamicResource ScrollBarRepeatButtonTemplate}" Command="ScrollBar.PageRightCommand" />
    			</Track.IncreaseRepeatButton>
    		</Track>
    		<RepeatButton x:Name="repeatButton1" Grid.Column="3" Template="{DynamicResource ScrollBarHorizontalIncrementTemplate}" Width="17" Command="ScrollBar.LineRightCommand" Opacity="0"/>
    	</Grid>
    </ControlTemplate>
</ResourceDictionary>